﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Timer1_Tick(object sender, EventArgs e)
    {
        SetImageUrl();
    }

    private void SetImageUrl()
    {
        if (ViewState["imageShowed"] == null)
        {
            slideImage.ImageUrl = "~/Images/1.jpg";
            ViewState["imageShowed"] = 1;
        }

        else
        {
            int i = (int)ViewState["imageShowed"];

            if (i == 3)
            {
                slideImage.ImageUrl = "~/Images/1.jpg";
                ViewState["imageShowed"] = 1;
            }
            else
            {
                i = i + 1;
                slideImage.ImageUrl = "~/Images/" + i.ToString() + ".jpg";
                ViewState["imageShowed"] = i;
            }

        }

    }
}
